{{ $tag := .File.BaseFileName }}
{{ $type := .CurrentSection.Params.component_type }}
{{ $docs := index (index site.Data.docs.components $type) $tag }}
{{ $desc := .Description }}
{{ $tags := slice }}
{{ $tags = $tags | append $type }}

{{ if $docs.input.logs }}
{{ $tags = $tags | append "logs" }}
{{ end }}

{{ if $docs.input.metrics }}
{{ $tags = $tags | append "metrics" }}
{{ end }}

<a href="{{ .RelPermalink }}">
  <div class="component-card is-hoverable" x-data="{ tags: {{ $tags | jsonify }} }">
    <header class="component-card-header">
      {{ .Title }} {{ .Params.kind }}
    </header>

    {{ with $desc }}
    <div class="component-card-content">
      <p>
        {{ . | markdownify | plainify }}
      </p>
    </div>
    {{ end }}
  </div>
</a>
